package com.example.capsule_netty.controller;

import com.example.capsule_netty.bean.PositionBean;
import com.example.capsule_netty.configuration.Constant;
import com.example.capsule_netty.impl.PositionServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: zhuzhiming
 * @Date: 2022/5/18 12:44
 */
@RestController
public class PositionController {

    @Autowired
    PositionServiceImpl positionService;

    @PostMapping("/uploadPosition")
    public String uploadPosition(@RequestBody PositionBean positionBean) {
        positionService.uploadPosition(positionBean);
        return Constant.SUCCESS;
    }


    @PostMapping("/getNearPeople")
    public String getNearPeople(@RequestBody PositionBean positionBean) {
        return positionService.getNearPeople(positionBean);
    }

    @PostMapping("getDistance")
    public String getDistance(@RequestBody PositionBean positionBean) {

        return positionService.getDistance(positionBean);

    }


}
